<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.min.js"></script>
    <title>支付宝支付页面</title>
</head>

<body>
    <script>
        var errcode = new Array();
        errcode['9000'] = '订单支付成功';
        errcode['4000'] = '订单支付失败';
        errcode['6001'] = '用户中途取消';
        errcode['6002'] = '网络连接出错';
        errcode['99'] = '用户点击忘记密码导致快捷界面退出';
        //支付宝jsapi支付
        function alpay() {
            ap.tradePay({
                tradeNO: '{$tradeno}'
            }, function (res) {
                if (res.resultCode == 9000) {
                    //判断是否支付
                    ap.alert(errcode[res.resultCode], function () {
                        ap.popWindow();
                    });
                } else {
                    ap.alert(errcode[res.resultCode], function () {
                        ap.popWindow();
                    });
                }
            });
        }
        alpay();
    </script>

</body>

</html>